php forum
php mysql forum
php mysql smarty
 
Topic Options
#271347 - 03/23/04 03:43 PM Beta-[6.2-6.3-6.4] MaxOnline 1.2
Rick Offline
Guru

Registered: 05/11/99
Posts: 8373
Loc: Olympia, WA
Mod Name / Version: MaxOnline 1.2 <br /> <br />Description: This limits the maximum number of users that can be on your forum at any given time. <br /> <br />Working Under: UBB.Threads 6.2-6.3-6.4 <br /> <br />Mod Status: Beta <br /> <br />Any pre-requisites: <br /> <br />Author(s): Scream <br /> <br />Date: 03/23/04 <br /> <br />Credits: <br /> <br />Files Altered: ubbt.inc.php <br /> <br />New Files: <br /> <br />Database Altered: <br /> <br />Info/Instructions: Just add this bit of code into the authenticate function in the ubbt.inc.php file. Change the $maxonline variable to the maximum number of users that can be online for your site. <br /> <br />Change $adminuser to your admin user number to bypass this check for that user so they can always login. In order for this bypass to work, when logging in you must choose the "Remember me" box. <br /> <br />Change $goodscripts to include any scripts that you want to bypass this check, seperate them with a |. <br /> <br />Once the maximum threshold has been reached users will get an error stating that there are too many users online at that time, and to please try back later. Once a user is logged in they are excluded from this check, so the error message will only be given to guests that haven't logged in yet. <br /> <br />Note, that this does add one extra query per page for any users that aren't currently logged in. <br /> <br />Disclaimer: Please backup every file that you intend to modify. <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /> <br />Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.


Attachments
110647-maxonline.txt (68 downloads)



Edited by Scream (03/23/04 09:50 PM)

Top
#271348 - 03/23/04 03:49 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: Sally]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
<img src="http://www.ubbdev.com/forum/images/graemlins/waytogo.gif" alt="" /><br /><br />Thanks!
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#271349 - 03/23/04 03:52 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: Daine]
Slurpee Offline
Member

Registered: 01/11/00
Posts: 322
Awesome thanks Scream!
_________________________
Webmaster Van Halen Links.com
http://www.vhlinks.com
UBB Support Moderator
http://community.infopop.net/

Top
#271350 - 03/23/04 04:02 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: Daine]
slayer60 Offline
Junior Member

Registered: 06/14/03
Posts: 1185
Loc: New Boston, NH
Now there's something you don't see everyday. A hack from Scream.<br /><br />BTW, Your new avatar is cool. If you stare at it long enough the dragons seem to move...Well, maybe that's just me.

Top
#271351 - 03/23/04 04:03 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: SusanA]
ericgtr Offline
Junior Member

Registered: 05/12/03
Posts: 1109
Man Scream, did you just whip that up over a cup of coffee or what? It took you like ten minutes to come up with that. Very slick mod <img src="http://www.ubbdev.com/forum/images/graemlins/waytogo.gif" alt="" />

Top
#271352 - 03/23/04 04:08 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: Sally]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8373
Loc: Olympia, WA
Two small changes to this. the reference to my_id needs to get changed to my_sess otherwise users that have the remember me key set will get logged in even if the max is exceeded. Also, the check would allow for one more than your maxonline variable. I just updated the attachment with both of these changes.


Edited by Scream (03/23/04 04:15 PM)
_________________________
UBB.threads Developer

Top
#271353 - 03/23/04 04:09 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: BlarC]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8373
Loc: Olympia, WA
Well, I do have a bit of an advantage in that I pretty much know every nook and cranny of the code <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" />
_________________________
UBB.threads Developer

Top
#271354 - 03/23/04 04:10 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: BrokenToy]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8373
Loc: Olympia, WA
Well, since it's something that probably won't get into the standard release I figured it couldn't hurt to help out a bit <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /><br /><br />And my avatar does emit a hallucenagentic drug when you stare at it. That could be what's happening <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" />
_________________________
UBB.threads Developer

Top
#271355 - 03/23/04 04:16 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: Sally]
ericgtr Offline
Junior Member

Registered: 05/12/03
Posts: 1109
I've stashed this away for use when my server gets overloaded. Judging from what you mentioned above I can see why you wouldn't want it to be in a standard release, however this is extremely handy for those of us that don't necessarily want to upgrade (or can't afford to) servers to keep up with increasing traffic, especially on sites that aren't making money.

Top
#271356 - 03/23/04 04:35 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: BlarC]
slayer60 Offline
Junior Member

Registered: 06/14/03
Posts: 1185
Loc: New Boston, NH
Would it be possible for this allow Admins to log in regardless of how many users are online? <br /> <br />And, the halucenagenic drug emission must be it.

Top
#271357 - 03/23/04 04:47 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: BrokenToy]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8373
Loc: Olympia, WA
Sure, instructions and attachments updated for adding an admin user that can login no matter what.
_________________________
UBB.threads Developer

Top
#271358 - 03/23/04 06:03 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: Sally]
Slurpee Offline
Member

Registered: 01/11/00
Posts: 322
Hmm that admin thing didn't work for me on 6.2.2. It seems it can't get the user number until you actually log in. And you can't get the login screen if the online count is over the set number.
_________________________
Webmaster Van Halen Links.com
http://www.vhlinks.com
UBB Support Moderator
http://community.infopop.net/

Top
#271359 - 03/23/04 06:25 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: SusanA]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8373
Loc: Olympia, WA
Hmm, it should work even in that version, same cookie was used.<br /><br />What you can try to do is right above the $maxusers definition, add this:<br /><br />echo ${$config['cookieprefix']."w3t_myid"};<br />exit;<br /><br />See if it prints any number out for you at all when it fails.
_________________________
UBB.threads Developer

Top
#271360 - 03/23/04 06:44 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: Sally]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8373
Loc: Olympia, WA
Ok, I get it now. In order to bypass the check when logging in you need to use the "remember me" bit. If you log out completely or you don't choose the "remember me" box then it won't work properly since there is no identification of who you are and this hack needs to come before any of that identification can take place.
_________________________
UBB.threads Developer

Top
#271361 - 03/23/04 07:27 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: Sally]
Slurpee Offline
Member

Registered: 01/11/00
Posts: 322
Yep that's what I figured, makes total sense now. Thanks!<br /><br />Anyway easily you know of to allow the "new user" link to work with this. I wouldn't mind people registering new usernames even if they can't access board.
_________________________
Webmaster Van Halen Links.com
http://www.vhlinks.com
UBB Support Moderator
http://community.infopop.net/

Top
#271362 - 03/23/04 07:44 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: SusanA]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8373
Loc: Olympia, WA
Modified the attachment. Added a new variable called $goodscripts that can contain any scripts you want to bypass the check, seperating them with a |. By default it will allow them to run the newuser and adduser scripts.
_________________________
UBB.threads Developer

Top
#271363 - 03/23/04 10:34 PM Re: Beta-[6.2-6.3-6.4] MaxOnline 1.0 [Re: Sally]
Slurpee Offline
Member

Registered: 01/11/00
Posts: 322
That is perfect, thanks for doing this today Scream. Mucho appreciated. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /> Really saved me.
_________________________
Webmaster Van Halen Links.com
http://www.vhlinks.com
UBB Support Moderator
http://community.infopop.net/

Top



Moderator:  Ian_W 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks